package com.dd.stack.mybatisplus.controller;

import com.dd.stack.mybatisplus.service.task.impl.ExplainTypeVerificationTask;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author liuxianmeng
 * @CreateTime 2025/3/25 23:43
 * @Description 用于验证内置查询优化工具EXPLAIN得出的type列
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/sql/query/explain")
@Api(tags = "用于验证MySQL内置性能分析工具EXPLAIN得出的type列值")
public class ExplainTypeVerificationController {

    private final ExplainTypeVerificationTask etvt;

    @PutMapping("/type/verification")
    @ApiOperation("生成测试 用于验证MySQL内置性能分析工具EXPLAIN得出的type列值")
    public ResponseEntity<String> geneTestData() {
        etvt.geneTestData();
        return ResponseEntity.ok("生成测试数据成功~");
    }
}
